home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_073 / add / add.doc < prev    next >
Text File  |  1992-05-06  |  5KB  |  112 lines

  1. ADD - create keyboard shortcuts where no keyboard shortcuts have gone before.
  2.  
  3. Copyright ((c)) 1987, John Russell
  4.  
  5.     This is a small Intuition hack, which I'm surprised not to have seen
  6. anywhere before. It lets you take other people's menus, and customize them
  7. (at least with regards to keyboard equivalents, ie right-Amiga + <key>
  8. combinations). The idea was brought into my consciousness when I saw how
  9. MWB let you circumvent the assumptions made by other programmers in a
  10. transparent way, although it had probably been fermenting back there for a
  11. while :-).
  12.  
  13. Syntax:
  14. add <windowname> <menunumber> <itemnumber> [ <sub-item number> ] <key | "-kill">
  15.  
  16. Windowname is the name of the window (no matter what screen it is on) to
  17. which the menu you want to alter is attached. I ran into hassles with
  18. long window titles and those with spaces, so you only need specify the
  19. first word (eg VT100 instead of VT100 (2.4 861214... etc). Note that names
  20. *are* case sensitive.
  21.  
  22. All numbers are from 1 upwards, so "add window 1 1 X" is the upper-left-hand
  23. position in the menu list.
  24.  
  25. If you have 5 parameters it assumes the 4th is the position of a sub-item,
  26. not the shortcut itself. Otherwise, the 2nd and 3rd supply the position info
  27. and the 4th is the key to use.
  28.  
  29. The shortcut can be specified as upper or lower case; they are treated the
  30. same. Note that there is nothing to prevent you from creating duplicate
  31. shortcuts. Since I didn't want to get over-fancy, the size of the menu
  32. hitbox is unaltered and this may cause some (non-harmful) overlapping.
  33.  
  34. The "-kill" option is position-dependent (it must go last) and just turns
  35. off an existing shortcut.
  36.  
  37. --------------
  38.  
  39. Sample uses -
  40.  
  41. Install this file as s:loadwb   (instead of "loadwb", "execute loadwb")
  42.  
  43. loadwb
  44. until Workbench 60 -m ; wait until window opens and sets menu (also posted)
  45. addbuffers df0: 15
  46. add Workbench 1 1 O
  47. add Workbench 1 2 C
  48. add Workbench 1 3 D
  49. add Workbench 1 4 R
  50. add Workbench 1 5 I
  51. add Workbench 1 6 K   ;for kill
  52. add Workbench 2 1 E
  53. add Workbench 2 2 F   ;for format
  54. add Workbench 3 4 S
  55. add Workbench 3 5 V
  56.  
  57. If you use VT100 and don't have a compiler, you might want to install
  58. s:vt100   ("run vt100", then "execute vt100")
  59.  
  60. until VT100 60 -m   ;wait 'til VT100 opens window, sets menu strip
  61. addbuffers df0: 15  ;if none added before
  62. add VT100 1 1 C
  63. add VT100 1 2 A
  64. add VT100 2 1 1 L  ;I only use 3/1200 baud
  65. add VT100 2 1 2 H
  66. add VT100 2 1 3 -kill ;because this one was originally "H"
  67.  
  68. --------------
  69. Bugs/problems: 
  70.  
  71. Using 0 or negative numbers for menu positions is *not* recommended.
  72. Before I added the checks for end-of-menu, I would experience strange
  73. screen displays trying to access menu # 1000, etc. even though it was just
  74. de-referencing the pointers. Anyone know why?
  75.  
  76. Programs with a space as the first character in the window title (eg
  77. PageSetter) need to be filezapped (change the space to, say, a _).
  78.  
  79. Programs that re-use parts of the menu structure (eg Ahost); well, it doesn't
  80. hurt, but you can only specify 1 shortcut which shows up several times.
  81.  
  82. Programs that disable menu operations at various times (eg DPaint and
  83. Workbench) need to be taken case-by-case. I was disappointed about DPaint,
  84. although menu operations *are* allowed once the mouse is above the drawing
  85. area. For Workbench, just allow disk activity to cease before using add.
  86.  
  87. This was originally interactive, and I just hacked it into "expert" mode
  88. at someone's request. If I ever get more than 10 minutes at a time with it,
  89. I'll combine the two, and hopefully get to use some of the neato features
  90. like ItemAddress and the MenuNumber macro. Be warned, I fully intend to steal
  91. menus away from programs and let you select them in *mine*!
  92.  
  93. I can't accept responsibility for any damages that may occur as a result
  94. of using this program (although I highly doubt any will happen).
  95. --------------
  96. This program is made available as shareware. Anyone may give it to anyone,
  97. but not impose any conditions in doing so. If you feel that any and/or all
  98. programs you have from me have been worth $5 or so to you, you might want to 
  99. send a small donation to:
  100.  
  101. John Russell
  102. 5 Alderdice Place
  103. St. John's, NF, Canada
  104. A1B 2P8
  105. (709) 726-7847
  106.  
  107. If I get favourable response, I may expand the idea into a general screen/
  108. window/menu management program, allowing you to customize the Intuition-based
  109. features of other people's programs. Hmmm, I wonder what kind of
  110. copyright conundrums *that* might create? "But officer, the spreadsheet I 
  111. wrote has *none* of these filthy messages in it..."
  112.